<?php
function is_user_agent_ie()
{
    if (isset($_SERVER['HTTP_USER_AGENT']) && 
    (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        return true;
    else
        return false;
}
?>
<?php $link = 'http://www.facebook.com/dialog/oauth?client_id='.sfConfig::get('app_facebook_app_id').'&redirect_uri='.url_for('user/facebook_logged_in',true).'&scope=email&display=popup' ?>
<div class="slider_right_logged_out">
    <form name="home_login" id="home_login" action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
        <div class="sign_in_text"><?php echo __('Sign Into Doseyeh') ?></div>
        <!--<div class="fb-login-button" data-scope="email"></div>-->
        <a onclick="window.open(this.href<?php if(!is_user_agent_ie()){ ?>,'facebook login','width=410,height=285'<?php } ?>);return false;" href="<?php echo $link ?>" class="iframe">
            <img src="<?php echo image_path('facebook_login.gif') ?>"/>
        </a>
        <div class="normal_login">
            <?php if (!$sf_user->hasFlash('error')) { ?>
                Or sign in by entering your username & password
            <?php } else { ?>
                <span class=red><?php echo $sf_user->getFlash('error') ?></span>
            <?php } ?>
        </div>
        <?php echo $form['_csrf_token'] ?>
        <div class="username_wrap"><input placeholder="Username or Email" name=signin[username]" type="text" /></div>
        <div class="username_wrap"><input placeholder="Password" name="signin[password]" type="password" /></div>
        <div class="forgot"><a href=""><?php echo __('Forgot your password ?') ?></a></div>
        <div class="signin_wrap">
            <div class="signin_button">
                <a href="javascript:void(0)" onclick="$('#home_login').submit();"><?php echo __('Sign In') ?></a>
            </div>
            <div class="not_registered"><?php echo __('Not Registered? Signup ') ?><a href="<?php echo url_for('user/register') ?>"><?php echo __('Here Free') ?></a></div>
        </div>
        <input type="submit" name="submit" value="" style="visibility: hidden"/>
    </form>
</div>


